<template>
  <div>
    <el-dialog title="删除记录"
               :visible.sync="isVisible"
               width="30%"
               :before-close="handleClose"
    >
      <slot name="body"></slot>
      <section class="tc mt-40">
        <el-button size="small" @click="handleClose">取消</el-button>
        <el-button type="primary" size="small" @click="handleSure">确定</el-button>
      </section>
    </el-dialog>
  </div>
</template>
<script lang="ts">
import { Vue, Component,Emit } from "vue-property-decorator";
import { State, Mutation } from "vuex-class";
import { resdel } from "@/api/api";

@Component({})
export default class ErrorDialog extends Vue {
  @State("isVisible") handleStateVisible: any;
  @Mutation('handleCloseVisible') handleCloseVisible:any;
  @Emit('del')
  protected handleUpdate(){}
  protected name!: "ErrorDialog";
  get isVisible() {
    return this.handleStateVisible;
  }

  protected handleClose(){
    this.handleCloseVisible({value:this.handleStateVisible})
  }
  protected async handleSure(){
    this.handleUpdate()
  }
}
</script>

<style scoped lang="scss">
/deep/ .el-dialog__title {
  font-size: 16px;
}
</style>
